using UnityEngine;

public class TankBattleController : MonoBehaviour
{
	public static TankBattleController instance;

	public Transform[] startPositions;

	public LayerMask mask;

	private bool gotMyTank;

	private void Awake()
	{
		instance = this;
	}

	public void SpawnTank(SpawnPointChief.SpawnPoint point)
	{
		if (!gotMyTank)
		{
			PrivateCarManager.instance.CarInstantiate(settings.SelectedTankName);
			gotMyTank = true;
		}
		PrivateCarManager.instance.CallCar(point, false);
		PlayerBehavior.MyPlayer.isImmortal = true;
		Invoke("GetIn", 0.1f);
	}

	private void GetIn()
	{
		PlayerBehavior.MyPlayer.GetInCarWithConfirmation(PlayerBehavior.MyPlayer.viewId, PrivateCarManager.instance.currentCar.viewId);
		PlayerBehavior.MyPlayer.isImmortal = false;
	}
}
